"use strict";

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    const productions = [];
    const counts = 1000;

    for (let i = 21; i <= counts; i++) {
      const production = {
        sizeRuleId: `${10}`,
        long: `980`,
        wide: `690`,
        height: `920`,
        presetsNum: `4`,
        layerNum: `2`,
        palletizingNum: `8`,
        grippingDirection: `1`,
        leftAndRightFaultToleranceNum: `${i}`,
        faultToleranceBeforeAndAfterNum: `${i}`,
        userId: "13",
        userName: "admin",
        beUsed: (i % 4) + 1,
        lineName: i % 2 == 0 ? "A" : "B",
        status: "0",
        palletCode: `${i}`,
        sn: `${i}`,
        productCode: `${i}`,
        sono: `${i}`,
        soline: `${i}`,
        weight: `${i}`,
        deletedAt: null,
        timestamp: new Date(),
        createdAt: new Date(),
        updatedAt: new Date(),
      };

      productions.push(production);
    }

    await queryInterface.bulkInsert("Productions", productions, {});
  },

  async down(queryInterface, Sequelize) {
    await queryInterface.bulkDelete("Productions", null, {});
  },
};
